package cn.hbu.zlfw.admin.entity;

import java.io.Serializable;
import java.util.Date;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
import javax.persistence.ManyToMany;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import javax.validation.constraints.Size;

import org.hibernate.annotations.GenericGenerator;
import org.hibernate.validator.constraints.NotBlank;
import cn.hbu.zlfw.patent.entity.Patent;

/**
 * 
* @ClassName: Expert
* @Description: 专家实体类
* @author tiddar
* @date 2018年8月8日
*
 */
@Entity
@Table(name="t_expert")
public class Expert implements Serializable{

	private static final long serialVersionUID = -3240141955360403388L;
	
	@Id
	@Column(name="id",length=32)
	@GeneratedValue(generator="UUID_KEY")
	@GenericGenerator(name="UUID_KEY",strategy="uuid.hex")
	private String id;
	
	@Column(name="userType",length=20,nullable=false)
	private Integer userType;
	
	@NotBlank(message = "{NotBlank.scienceExpert.userName}")
	@Column(name="userName",length=100,nullable=false)
	private String userName;
	
	@NotNull(message = "{NotNull.scienceExpert.schoolType}")
	@Column(name="schoolType",length=20,nullable=false)
	private Integer schoolType;
	
	
	@NotBlank(message = "{NotBlank.scienceExpert.department}")
	@Column(name="department",length=80,nullable=false)
	private String department;
	
	@Pattern(regexp="\\d{11}",message= "{Pattern.scienceExpert.phoneNumber}")
	@Column(name="phoneNumber",length=100,nullable=false)
	private String phoneNumber;
	
	@Size(min=8,max=20,message = "{Size.scienceExpert.password}")
	@Column(name="password",length=100,nullable=false)
	private String password;
	
	@NotBlank(message = "{NotBlank.scienceExpert.subjectTypes}")
	@Column(name="subjectTypes",nullable=false)
	private String subjectTypes;	//擅长学科
	
	@Column(name="QQ",length=100)
	private String QQ;
	
	@Column(name="weChat",length=100)
	private String weChat;
	
	@Column(name="delState",length=20,nullable=false)
	private Integer delState;		//0表示未删除 1表示删除
	
	@Temporal(TemporalType.TIMESTAMP)
	@Column(name="createTime",nullable=false)
	private Date createTime;
	
	@Temporal(TemporalType.TIMESTAMP)
	@Column(name="updateTime",nullable=false)
	private Date updateTime;

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public Integer getUserType() {
		return userType;
	}

	public void setUserType(Integer userType) {
		this.userType = userType;
	}

	public String getUserName() {
		return userName;
	}

	public void setUserName(String userName) {
		this.userName = userName;
	}

	public Integer getSchoolType() {
		return schoolType;
	}

	public void setSchoolType(Integer schoolType) {
		this.schoolType = schoolType;
	}

	public String getDepartment() {
		return department;
	}

	public void setDepartment(String department) {
		this.department = department;
	}

	public String getPhoneNumber() {
		return phoneNumber;
	}

	public void setPhoneNumber(String phoneNumber) {
		this.phoneNumber = phoneNumber;
	}

	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	public String getSubjectTypes() {
		return subjectTypes;
	}

	public void setSubjectTypes(String subjectTypes) {
		this.subjectTypes = subjectTypes;
	}

	public String getQQ() {
		return QQ;
	}

	public void setQQ(String qQ) {
		QQ = qQ;
	}

	public String getWeChat() {
		return weChat;
	}

	public void setWeChat(String weChat) {
		this.weChat = weChat;
	}

	public Integer getDelState() {
		return delState;
	}

	public void setDelState(Integer delState) {
		this.delState = delState;
	}

	public Date getCreateTime() {
		return createTime;
	}

	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}

	public Date getUpdateTime() {
		return updateTime;
	}

	public void setUpdateTime(Date updateTime) {
		this.updateTime = updateTime;
	}
	

	@Override
	public String toString() {
		return "ScienceExpert [id=" + id + ", userType=" + userType + ", userName=" + userName + ", schoolType="
				+ schoolType + ", department=" + department + ", phoneNumber=" + phoneNumber + ", password=" + password
				+ ", subjectTypes=" + subjectTypes + ", QQ=" + QQ + ", weChat=" + weChat + ", delState=" + delState
				+ ", createTime=" + createTime + ", updateTime=" + updateTime + "]";
	}
}	
